﻿@{
    ViewBag.Title = "家庭成员";
}
@section header{

}
<form id="form1">
    <div class="form-layout">
        <input type="hidden" name="ID" value="" />
        <table class="form">
            <tr>
                <th class="formTitle">姓名</th>
                <td class="formValue">
                    <input id="Name" name="Name" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">与本人关系</th>
                <td class="formValue">
                    <input id="Relations" name="Relations" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">单位</th>
                <td class="formValue">
                    <input id="Unit" name="Unit" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">文化程度</th>
                <td class="formValue">
                    <input id="Education" name="Education" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

            <tr>
                <th class="formTitle">联系方式</th>
                <td class="formValue">
                    <input id="Contact" name="Contact" type="text" class="form-control " autocomplete="off" />
                </td>
            </tr>

        </table>
    </div>
</form>

@section scripts{
    <script>
        var baseUrl = "/Personnel/Socialrelations/";
        var keyValue = $.request("keyValue");
        $(function () {
            initControl();
            if (!!keyValue) {
                $.ajax({
                    url: baseUrl + "GetFormJson",
                    data: { keyValue: keyValue },
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        $("#form1").formSerialize(data);
                    }
                });
            }
        });
        function initControl() {

        }
        function submitForm() {
            if (!$('#form1').formValid()) {
                return false;
            }
            $.submitForm({
                url: baseUrl + "SubmitForm?keyValue=" + keyValue,
                param: $("#form1").formSerialize(),
                success: function () {
                    $.currentWindow().$("#gridList").resetSelection();
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        }
    </script>
}